package com.tebiecloud.mpweixin.server.service;

import com.tebiecloud.mpweixin.client.model.entity.MpweixinUserWallet;
import com.tebiecloud.common.mybatis.base.service.IBaseService;
import com.tebiecloud.mpweixin.client.model.vo.AccountInfoVO;
import com.tebiecloud.mpweixin.client.model.vo.DeductUserAmount;
import com.tebiecloud.mpweixin.client.model.vo.PlusUserAmountVo;
import com.tebiecloud.mpweixin.client.model.vo.WithdrawInfoVO;
import com.tebiecloud.order.client.model.vo.NotArrivedList;

import java.util.List;

/**
 *  服务类
 * @author tebie
 * @date 2019-09-16
 */
public interface MpweixinUserWalletService extends IBaseService<MpweixinUserWallet> {


    /**
     * 获取余额信息接口
     * @return
     */
    AccountInfoVO infoAccount();

    /**
     * 获取未到账余额列表
     * @param userId
     * @return
     */
    List<NotArrivedList> selectNotArriedList(Long userId);

    /**
     * 获取可提现信息
     * @return
     */
    WithdrawInfoVO infoWithdraw();

    /**
     * 查询用户钱包并创建
     * @param userId
     * @return
     */
    MpweixinUserWallet createOrFind(long userId);

    /**
     * 扣减用户钱包
     * @param userId
     * @param amount
     * @param maxCoin
     * @return
     */
    DeductUserAmount updateDeductAmount(long userId, int amount, int maxCoin);

    /**
     * 增加用户钱包
     * @param userId
     * @param amount
     * @param coin
     * @return
     */
    PlusUserAmountVo updatePlusAmount(long userId, int amount, int coin);

    /**
     * 回滚余额
     * @param orderId
     * @param userId
     * @param amount
     * @param coin
     * @param type
     * @return
     */
    PlusUserAmountVo callBackPlusAmount(long orderId, long userId, int amount, int coin, int type);
}
